#/bin/bash

cd $(dirname $0)
cd ..
pwd

OUTDIR=~/tmp/note-recog
rm -rf $OUTDIR
mkdir -p $OUTDIR

for CONFIG in Debug Release
do
    for ARCH in iphoneos5.0 iphonesimulator5.0
    do
        xcodebuild -project note-recog.xcodeproj -configuration $CONFIG -sdk $ARCH clean
        xcodebuild -project note-recog.xcodeproj -configuration $CONFIG -sdk $ARCH
    done
done

cp -r build/* $OUTDIR
find $OUTDIR | egrep "octest|Objects|Tests|\.build" | xargs rm -rf
find $OUTDIR 
